package invoker;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import controle.BuscaMaterialCommand;;

/**
 * Servlet implementation class ReservaInvoker
 */
public class MaterialInvoker extends HttpServlet {
	private static final long serialVersionUID = 1L;
    private BuscaMaterialCommand buscar;  

    /**
     * @see HttpServlet#HttpServlet()
     */
    public MaterialInvoker() {
        super();
        buscar = new BuscaMaterialCommand();
        // TODO Auto-generated constructor stub
    }

	/**
	 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
	 */
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
	}

	/**
	 * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		System.out.print("LOG: BuscaInvoker");
		String command=request.getParameter("command");
		
		if(command.equals("buscar"))
		{
			System.out.println(" buscar");
			buscar.execute(request,response);
		}
		
	}

}
